
import $qs from 'qs'
import * as CONFIG from './config'

function $q(param) {
  return $qs.stringify(param)
}
// let baseURL = 'http://gokplus.yunmansk.com/goktech'
let baseURL = '//www.goktech.cn/gw-ht'
// let baseURL = 'http://192.168.2.85:8080'

// 底部关于我们
function tAboutGoktech() {
    return this.$http.jsonp(baseURL+`/f/tAboutGoktech/taboutUsList`).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
// 获取首页公司动态
function HomeNewsIndexlist(num) {
    return this.$http.jsonp(baseURL+`/f/tNews/tNewsIndexlist/${num}`).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
    
  }
//获取详情页 所有
function getDetailList(url) {
     return this.$http.jsonp(baseURL+url).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//获取详情页 单条
function getDetail(caseId) {
    return this.$http.jsonp(baseURL+`/f/tCase/tcaseDetail/${caseId}`).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
} 

//项目服务--业务介绍

//承接项目类型
function serviceProjectType(id) {
    return this.$http.jsonp(baseURL+'/f/tprojecttype/projecttype?remarks='+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
} 

//团队资质

function serviceTeam() {
    return this.$http.jsonp(baseURL+'/f/tprojecttype/teamQualType/1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
//覆盖厂商
function serviceOverlay(id) {
    return this.$http.jsonp(baseURL+'/f/corporation/corporation_list/'+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

// 联系人
function serviceContcat(id) {
    return this.$http.jsonp(baseURL+'/f/contact2/contact2ByType_list?type='+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//项目服务--服务案例

function serviceCaseList() {
    return this.$http.jsonp(baseURL+'/f/tCase/tcaseList?remarks=1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//软件研发--业务介绍

//服务资质
function developTeam() {
    return this.$http.jsonp(baseURL+'/f/descprit/authorities?type=4').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
//软件研发--服务案例
function developCaseList() {
    return this.$http.jsonp(baseURL+'/f/tCase/tcaseListByType?remarks=1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//国科学院--学院简介

//培训体系
function collegeTrainList() {
    return this.$http.jsonp(baseURL+'/f/CollegeProfile/tTrainingsystem_List').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function collegeDataList() {
    return this.$http.jsonp(baseURL+'/f/CollegeProfile/tTrainingAchievement_List').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//ICT培训

// 课程内容标签页

function collegeTrainLable() {
    return this.$http.jsonp(baseURL+'/f/Tcourse/tCourse_type_list?coursetype=1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//ICT就业

function collegeEmployment(id) {
    return this.$http.jsonp(baseURL+'/f/CollegeProfile/employmentDirection_List?coursetype='+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//软件培训
function collegeSoftwareLable() {
    return this.$http.jsonp(baseURL+'/f/Tcourse/tCourse_type_list?coursetype=2').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//优秀学员

function collegeStudent() {
    return this.$http.jsonp(baseURL+'/f/fineStudent/fineStudent?type=1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function collegeTeacherStrength() {
    return this.$http.jsonp(baseURL+'/f/CollegeProfile/teacherStrength_List').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function collegeTeamList() {
    return this.$http.jsonp(baseURL+'/f/team/teamList').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
// 信息安全

//课程详情
function collegecourseDetals(type) {
    return this.$http.jsonp(baseURL+'/f/Tcourse/tCourse_type_list?coursetype='+type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//优秀学员
function excellentStudent(type) {
    return this.$http.jsonp(baseURL+'/f/fineStudent/fineStudent?type='+type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
//企业定制

//课程方向

function companyDirection() {
    return this.$http.jsonp(baseURL+'/f/CustomEnterprise/courseDirection').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//培训现场

function companySite() {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewslist/50').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//诚聘英才

//工作详情页
function jobDetail(id) {
    return this.$http.jsonp(baseURL+'/f/frontPosition/position?deptid='+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

//就业情况

function collegeTalentService() {
    return this.$http.jsonp(baseURL+'/f/talentService/getTalentService1').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function collegeTalentBySize() {
    return this.$http.jsonp(baseURL+'/f/talentService/getTalentService2?size=4').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function collegeResults() {
    return this.$http.jsonp(baseURL+'/f/Tstudent/tStudent_list').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function collegeJobStudent() {
    return this.$http.jsonp(baseURL+'/f/fineStudent/fineStudent').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
// 关于国科

// 合作资质
function aboutTeamwork() {
    return this.$http.jsonp(baseURL+'/f/cooptqualification/cooptqualification_list').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

// 首页banner 
function homeBanner(){
    return this.$http.jsonp(baseURL+'/f/tbanner/tBanner').then(res => {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
// 联系我们

// 商业合作
function aboutContact() {
    return this.$http.jsonp(baseURL+'/f/contact2/contact2ByType_list?type=2').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function aboutLocation() {
    return this.$http.jsonp(baseURL+'/f/contact/contact_list').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function aboutNews(type,pageNo,pageSize) {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewslist/'+type+'/'+pageNo+'/'+pageSize).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}


function aboutNewsDetail(id) {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewsDetail/'+id).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function aboutNewsPreDetail(id,type) {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewsPreDetail/'+id+ '/' + type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function aboutNewsNextDetail(id,type) {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewsNextDetail/'+id+ '/' + type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}


function aboutNewsBySize(type) {
    return this.$http.jsonp(baseURL+'/f/tNews/tNewslistBySize?type='+type+'&size=5').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function aboutContactList() {
    return this.$http.jsonp(baseURL+'/f/contact/contact_list').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function aboutMemorabiliaList() {
    return this.$http.jsonp(baseURL+'/f/tAboutGoktech/tMemorabiliaList').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function aboutUsList() {
    return this.$http.jsonp(baseURL+'/f/tAboutGoktech/taboutUsList?type=2').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function aboutMainBusiness() {
    return this.$http.jsonp(baseURL+'/f/mb/mainBusiness').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function authorities(type) {
    return this.$http.jsonp(baseURL+'/f/descprit/authorities?type='+type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
function profile(type) {
    return this.$http.jsonp(baseURL+'/f/descprit/profile?type='+type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function customEnterprise(type) {
    return this.$http.jsonp(baseURL+'/f/CustomEnterprise/descript?type='+type).then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}

function firstDeptTdeptList() {
    return this.$http.jsonp(baseURL+'/f/firstDept/tdeptList').then((res)=> {
        if(res.status == '200' && res.ok){
            return Promise.resolve(res.body)
        }
    })
}
export {
    firstDeptTdeptList,
    tAboutGoktech,
    HomeNewsIndexlist,
    getDetailList,
    getDetail,
    serviceProjectType,
    serviceTeam,
    serviceOverlay,
    serviceContcat,
    serviceCaseList,
    developTeam,
    developCaseList,
    collegeTrainList,
    collegeDataList,
    collegeTrainLable,
    collegeEmployment,
    collegeSoftwareLable,
    collegeStudent,
    collegeTeacherStrength,
    collegeTeamList,
    companyDirection,
    companySite,
    jobDetail,
    collegeTalentService,
    collegeTalentBySize,
    collegeResults,
    collegeJobStudent,
    aboutTeamwork,
    homeBanner,
    aboutContact,
    aboutLocation,
    aboutNews,
    aboutNewsDetail,
    aboutNewsPreDetail,
    aboutNewsNextDetail,
    aboutNewsBySize,
    aboutContactList,
    aboutMemorabiliaList,
    aboutUsList,
    aboutMainBusiness,
    authorities,
    profile,
    customEnterprise,
    collegecourseDetals,
    excellentStudent
}
